public class work4 {
    //461. 汉明距离
    public int hammingDistance(int x, int y) {
        int sum=0;
        for(int i=0;i<32;i++){
            int temp1=x&1;
            int temp2=y&1;
            if(temp1!=temp2)sum++;
            x>>=1;
            y>>=1;
        }
        return sum;
    }
}
